package io.kiki.sba.registry.common.model.constants;

import io.kiki.sba.registry.common.model.store.DataInfo;
import io.kiki.sba.registry.util.SystemUtils;


public class ValueConstants {

    /**
     * connectId: sourceAddress_targetAddress
     */
    public static final String CONNECT_ID_SPLIT = "_";

    /**
     * The constant DEFAULT_GROUP.
     */
    public static final String DEFAULT_GROUP = "DEFAULT_GROUP";

    /**
     * The constant DEFAULT_ZONE.
     */
    public static final String DEFAULT_ZONE = "DEFAULT_ZONE";

    public static final String DEFAULT_INSTANCE_ID = "DEFAULT_INSTANCE_ID";

    /**
     * The constant DEFAULT_DATA_CENTER.
     */
    public static final String DEFAULT_DATA_CENTER = "DefaultDataCenter";

    public static final long DEFAULT_NO_DATUM_VERSION = 1L;

    public static final String SESSION_PROVIDE_DATA_GROUP = "CONFIG";
    public static final String SESSION_PROVIDE_DATA_INSTANCE_ID = "9600";
    public static final String DISABLE_DATA_ID_CASE_SENSITIVE_SWITCH = "disable.dataId.case.sensitive";
    /**
     * switch for dataId sensitive is disable or not, default value is false which means dataId is
     * case sensitive
     */
    public static final boolean DISABLE_DATA_ID_CASE_SENSITIVE = Boolean.parseBoolean(SystemUtils.getSystem(DISABLE_DATA_ID_CASE_SENSITIVE_SWITCH));
    public static final String STOP_PUSH_DATA_SWITCH_DATA_ID = DataInfo.toDataInfoId(SESSION_PROVIDE_DATA_INSTANCE_ID, "session.stop.push.data.switch", SESSION_PROVIDE_DATA_GROUP);
    public static final String PUSH_SWITCH_GRAY_OPEN_DATA_ID = DataInfo.toDataInfoId(SESSION_PROVIDE_DATA_INSTANCE_ID, "session.push.switch.gray.open", SESSION_PROVIDE_DATA_GROUP);
    public static final String SHUTDOWN_SWITCH_DATA_ID = DataInfo.toDataInfoId(SESSION_PROVIDE_DATA_INSTANCE_ID, "session.shutdown.switch", SESSION_PROVIDE_DATA_GROUP);
    public static final String BLACK_LIST_DATA_ID = DataInfo.toDataInfoId(SESSION_PROVIDE_DATA_INSTANCE_ID, "session.blacklist.data", SESSION_PROVIDE_DATA_GROUP);
    public static final String CLIENT_OFF_ADDRESS_DATA_ID = DataInfo.toDataInfoId(SESSION_PROVIDE_DATA_INSTANCE_ID, "registry.client.off.list", SESSION_PROVIDE_DATA_GROUP);
    public static final String CIRCUIT_BREAKER_DATA_ID = DataInfo.toDataInfoId(SESSION_PROVIDE_DATA_INSTANCE_ID, "registry.circuit.breaker", SESSION_PROVIDE_DATA_GROUP);
    public static final String DATA_DATUM_SYNC_SESSION_INTERVAL_SEC = DataInfo.toDataInfoId(SESSION_PROVIDE_DATA_INSTANCE_ID, "data.datum.sync.session.interval.sec", SESSION_PROVIDE_DATA_GROUP);
    public static final String DATA_SESSION_LEASE_SEC = DataInfo.toDataInfoId(SESSION_PROVIDE_DATA_INSTANCE_ID, "data.session.lease.sec", SESSION_PROVIDE_DATA_GROUP);
    public static final String NODE_SERVER_OPERATING_DATA_ID = DataInfo.toDataInfoId(SESSION_PROVIDE_DATA_INSTANCE_ID, "registry.node.server.operating.data", SESSION_PROVIDE_DATA_GROUP);
    public static final String APP_REVISION_CLEANER_ENABLED_DATA_ID = DataInfo.toDataInfoId(SESSION_PROVIDE_DATA_INSTANCE_ID, "app_revision.cleaner.enabled", SESSION_PROVIDE_DATA_GROUP);
    public static final String INTERFACE_APP_CLEANER_ENABLED_DATA_ID = DataInfo.toDataInfoId(SESSION_PROVIDE_DATA_INSTANCE_ID, "interface_app.cleaner.enabled", SESSION_PROVIDE_DATA_GROUP);
    public static final String COMPRESS_PUSH_SWITCH_DATA_ID = DataInfo.toDataInfoId(SESSION_PROVIDE_DATA_INSTANCE_ID, "compress.push.switch", SESSION_PROVIDE_DATA_GROUP);
    public static final String COMPRESS_DATUM_SWITCH_DATA_ID = DataInfo.toDataInfoId(SESSION_PROVIDE_DATA_INSTANCE_ID, "compress.datum.switch", SESSION_PROVIDE_DATA_GROUP);
    public static final String APP_REVISION_WRITE_SWITCH_DATA_ID = DataInfo.toDataInfoId(SESSION_PROVIDE_DATA_INSTANCE_ID, "app_revision.write.switch", SESSION_PROVIDE_DATA_GROUP);
    public static final String CHANGE_PUSH_TASK_DELAY_CONFIG_DATA_ID = DataInfo.toDataInfoId(SESSION_PROVIDE_DATA_INSTANCE_ID, "change_push_task.delay.config", SESSION_PROVIDE_DATA_GROUP);
    public static final String ADMIN_API_TOKEN_DATA_ID = DataInfo.toDataInfoId(SESSION_PROVIDE_DATA_INSTANCE_ID, "admin.api.token", SESSION_PROVIDE_DATA_GROUP);
    // response status code
    public static final int METADATA_STATUS_PROCESS_SUCCESS = 200;
    public static final int METADATA_STATUS_DATA_NOT_FOUND = 404;
    public static final int METADATA_STATUS_PROCESS_ERROR = 500;
    public static final String ttr_rpc_channel_client_interface_id = "attr.registry.rpc.channel.clientInterfaceId";
    public static final String CLIENT_OFF = "clientOff";
    public static final String CLIENT_OPEN = "clientOpen";
    public static final String REDUCE = "reduce";
    public static final String BLOCKED_REQUEST_KEY = "!Blocked";
    public static final String META_LEADER_QUERY_URL = "http://%s:9615/meta/leader/query";
}
